package main

import (
	"io/ioutil"
	"log"
)

func main() {

	//源文件
	sourcePath := "C:/Users/i/Desktop/My/go-demos/files/Test10.txt"
	//目标文件
	targetPath := "C:/Users/i/Desktop/My/go-demos/files/Test20.txt"

	//	对source文件进行读取
	piece, err := ioutil.ReadFile(sourcePath)
	if err != nil {
		log.Println("出错了")
	}

	//	 写文件
	err2 := ioutil.WriteFile(targetPath, piece, 0666)
	if err2 != nil {
		log.Println("写入失败")
	}

}
